package com.itheima.service.impl;

import com.itheima.dao.BorrowMapper;
import com.itheima.service.BorrowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BorrowServiceImpl implements BorrowService {
    @Autowired
    private BorrowMapper borrowMapper;
    @Override
    public boolean findByBook(Integer id) {
        if (borrowMapper.findByBook(id)){
            return true;
        }
        return false;
    }

    @Override
    public boolean addBorrow(Integer id, Integer userId) {
         return borrowMapper.insert(id,userId);
    }
}
